package com.common.dto;

import com.common.constant.CommonConstant;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.springframework.util.StringUtils;

import java.lang.reflect.Type;

public class SiteTypeDetailsDto {

    private Integer index;

    private String aisleName;

    private Integer pointCount;

    private String aisleType;

    public static SiteTypeDetailsDto convert(String jsonStr){
        if (StringUtils.isEmpty(jsonStr)){
            return null;
        }
        Gson gson = CommonConstant.gson;
        Type type = new TypeToken<SiteTypeDetailsDto>() {}.getType();
        SiteTypeDetailsDto resp = gson.fromJson(jsonStr, type);
        return resp;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public String getAisleName() {
        return aisleName;
    }

    public void setAisleName(String aisleName) {
        this.aisleName = aisleName;
    }

    public Integer getPointCount() {
        return pointCount;
    }

    public void setPointCount(Integer pointCount) {
        this.pointCount = pointCount;
    }

    public String getAisleType() {
        return aisleType;
    }

    public void setAisleType(String aisleType) {
        this.aisleType = aisleType;
    }
}
